﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace ExtendBLL
{
    public class TimeSection:LabMS.BLL.CourseTiming
    {
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Update(LabMS.Model.CourseTiming model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update CourseTiming set ");
            strSql.Append("Nub=@Nub,");
            strSql.Append("STime=@STime,");
            strSql.Append("ETime=@ETime,");
            strSql.Append("季节=@季节");
            strSql.Append(" where ID=@ID and  季节=@季节");
            SqlParameter[] parameters = {
					new SqlParameter("@ID", SqlDbType.Int,4),
					new SqlParameter("@Nub", SqlDbType.Int,4),
					new SqlParameter("@STime", SqlDbType.DateTime),
					new SqlParameter("@ETime", SqlDbType.DateTime),
					new SqlParameter("@季节", SqlDbType.Int,4)};
            parameters[0].Value = model.ID;
            parameters[1].Value = model.Nub;
            parameters[2].Value = model.STime;
            parameters[3].Value = model.ETime;
            parameters[4].Value = model.季节;
            int count;
            count=Maticsoft.DBUtility.DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
            return count;
        }
    }
}
